import { AddRoleComponent } from './manage-role/add-role/add-role.component';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { NgModule } from '@angular/core';
import { UserManagementComponent } from './user-management.component';
import { RouterModule, Routes } from '@angular/router';
import { ShareModule } from 'app/shared/ShareModule';
import { ManageUsersComponent } from './manage-users/manage-users.component';
import { ManageRoleComponent } from './manage-role/manage-role.component';
import { PublicComponentModule } from 'app/public/public-component.module';
import { AddUserComponent } from './manage-users/add-user/add-user.component';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { ManageAccessRightsComponent } from './manage-access-rights/manage-access-rights.component';
import { ManageOrganizationComponent } from './manage-organization/manage-organization.component';
import { AddOrganizationComponent } from './manage-organization/add-organization/add-organization.component';

const COMPONENT = [
    UserManagementComponent,
    ManageRoleComponent,
    ManageAccessRightsComponent,
    ManageOrganizationComponent,
    ManageUsersComponent,
    AddUserComponent,
    AddRoleComponent,
    AddOrganizationComponent
];

const routes: Routes = [
    {
        path: '',
        component: UserManagementComponent,
        children: [
            { path: '', redirectTo: 'manage-users', pathMatch: 'full' },
            { path: 'manage-users', component: ManageUsersComponent },
            { path: 'manage-role', component: ManageRoleComponent },
            { path: 'manage-access-rights', component: ManageAccessRightsComponent },
            { path: 'manage-organization', component: ManageOrganizationComponent }
        ]
    }
];

@NgModule({
    imports: [ShareModule, NgZorroAntdModule, PublicComponentModule, RouterModule.forChild(routes), ReactiveFormsModule, FormsModule],
    declarations: COMPONENT
})
export class UserManagementModule {}
